/*
* Copyright (c) 2007 by Kirill Kolodyazhniy.
* See the file "license.terms" for information on usage and redistribution.
*/

#ifndef M_MATERIAL_H
#define M_MATERIAL_H

#include <string>
#include "resource.h"
#include "types.h"

#include <map>

namespace Engine
{
	/**
	*   Abstract implementation of rendering pass (render states and shaders)
	*/
	class Pass
	{
	public:
		virtual ~Pass(){}
		/**
		*   Apply some render states.
		*/
		virtual void Begin() const = 0;
		/**
		*   Restore device state.
		*/
		virtual void End() const = 0;
	};

	/**
	*   Abstract effect implementation for specific hardware level.
	*/
	class Technique
	{
	public:

		Technique(const std::string& name):m_name(name){}

		virtual ~Technique(){}

		/**
		*   Return name.
		*/
		const std::string& GetName() const {return m_name;}

		/**
		*   Return pass count.
		*/
		virtual unsigned int GetPassCount() const = 0;

		/**
		*   Return all passes for this technique.
		*/
		virtual const PassPtr GetPass(unsigned int index) const = 0;

	private:
		std::string m_name;
	};


	/**
	*   Abstract class - visual properties of objects definition.
	*/
	class Material: public Resource
	{
	public:

		Material(const std::string& name):Resource(name){}

		virtual ~Material(){}

		/**
		*   Return true if material has alpha blend operations.
		*/
		virtual bool IsTransparent()const = 0;

		/**
		*   Return technique bass much current hardware.
		*/
		virtual const TechniquePtr GetBestTechnique() const = 0;
	};

	/**
	*   Object for creating materials.
	*/
	class MaterialFactory: public ResourceFactory
	{
	};
}

#endif
